// pages/my/my.ts
import { HttpMethod, HttpRequest } from '../../resources/utils/request'

Page({
  data: {},
  onLoad() {
    this.customTabBarStatusChange()
  },

  onShow() {
    this.getNumber()
  },

  // tabbar状态修改
  customTabBarStatusChange() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        selected: 1,
        'numberList[0]': 2
      })
    }
  },

  async getNumber() {
    let res = await HttpRequest.getInstance().request({
      url: '/serviceProduct/showcase/getShowcase',
      method: HttpMethod.GET
    })
    console.log(res)
    if (res.data.code == 0) {
      console.log(res.data.data);
      this.setData({list:res.data.data})
    } else{
      wx.showToast({
        title: res.data.data.message || res.data.msg || res.errMsg,
        icon: "none"
      });
      console.error(res.data.data);
    }
  }
})
